package realestate.flat;

import realestate.entity.Flat;
import realestate.entity.ObjectOnMapShort;
import realestate.manager.request.ObjectOnMapShortRequest;
import realestate.manager.request.RealEstateRequest;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 08.04.11
 * Time: 17:01
 * To change this template use File | Settings | File Templates.
 */
public class FlatRequest extends RealEstateRequest {

	private StringBuilder filter_builder = new StringBuilder(2000);

	static {
		select_field_set = select_field_set.replaceFirst(ObjectOnMapShortRequest.CLASS_REPLCATE_MARK, FlatShortObject.class.getCanonicalName());
	}

	@Override
	protected boolean isRequestParameter(String parameter_name) {
		return parameter_name.equals(Flat.FIELD_ROOMS_COUNT) || super.isRequestParameter(parameter_name);
	}

	@Override
	protected StringBuilder getFilterBuilder() {
		return filter_builder;
	}

	@Override
	public String buildFilterString() {
		return filter_builder.append(" ")+super.buildFilterString();
	}

	@Override
	protected String getClassName() {
		return Flat.class.getSimpleName();
	}
}
